package eArCon.application;

import org.eclipse.uml2.uml.Model;

import backboneCode.*;

public class E_ArConApplication {
	
	private static ModelCode modelCode = new ModelCode();
	private static Reporter reporter = new Reporter();
	
	// method main(): ALWAYS the APPLICATION entry point
	public static void main(String[] argv) {
		
		for (int i = 0; i < argv.length; i++) {
			System.out.println("Arg " + i + ": " + argv[i]);
		}
//		System.out.println("Hello World!");
//		System.out.println();
		
		//TODO: Get a question regarding if ArCon are only going to use explicit defined rules, or 
		//		a more hands on approach, i.e. if it's not explicit defined, it's not allowed.
		GlobalStorage.OnlyUseExplicitDefinedRules = false;
		
		String[] argv1 = new String[2];
		argv1[0] = "C:/Documents and Settings/Johan/Desktop/ArCon related work/Test fall/T12/T12_arch.uml";
		argv1[1] = "C:/Documents and Settings/Johan/Desktop/ArCon related work/Test fall/T12/T12_system.uml";
		//argv1[0] = "C:/Documents and Settings/Johan/workspace/TopCasedModel/Models/ClassDiagram.uml";
		//argv1[1] = "C:/Documents and Settings/Johan/workspace/TopCasedModel/Models/UseCaseDiagram.uml";

		//argv[0] should be the architectural model
		System.out.println("Loading architectural rules....");
		Model archModel = modelCode.getModel(argv1[0]);
		modelCode.IterateArchModel(archModel);		
		
		//argv[1] should be the system model
		System.out.println("Loading system model....");
		Model sysModel = modelCode.getModel(argv1[1]);
		modelCode.ApplyRules(sysModel);
		modelCode.IterateSystemModel(sysModel);
		
		System.out.println("Checking rules....");
		reporter.CheckRules();
		System.out.println("Done!");
		
		return;
	}
	
	
	

}
